package cn.xopencode.securityservice.convert.suggest;


import cn.xopencode.securityservice.dal.mysql.dataobject.suggest.SuggestDO;
import cn.xopencode.securityservice.rpc.suggest.dto.SuggestCreateReqDTO;
import cn.xopencode.securityservice.rpc.suggest.dto.SuggestRespDTO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import cn.xopencode.common.framework.vo.PageResult;

@Mapper
public interface SuggestConvert {

    SuggestConvert INSTANCE = Mappers.getMapper(SuggestConvert.class);
    SuggestDO convert(SuggestCreateReqDTO bean);
    SuggestRespDTO convert(SuggestDO bean);

    @Mapping(source = "records", target = "list")
    PageResult<SuggestRespDTO> convertPage(IPage<SuggestDO> page);

}

